In NAND flash memory, all the word lines are set to 0 V, and the well voltage is increased, so that collective erasing is performed on all the memory cells in a subject block. Meanwhile, memory cells vary in characteristics. Some memory cells always exist in lower regions in the threshold value distribution and have poor reactions, some memory cells have high neutral threshold values, and some memory cells have high threshold values prior to erasing. Therefore, erasing in all the memory cells might not be completed by a single erasing operation, and excessive stress might be applied to memory cells in which erasing has been completed in early stages.